//
//  LAXAlertView.swift
//  MeiLiTV
//
//  Created by 冰凉的枷锁 on 2017/3/31.
//  Copyright © 2017年 冰凉的枷锁. All rights reserved.
//

import Foundation
import UIKit

class LAXAlertView {
    
    class func alertViewWarning(message: String) -> UIAlertController {
        let alert = UIAlertController.init(title: "警告", message: message, preferredStyle: .alert)
        let cancel = UIAlertAction.init(title: "确定", style: .cancel, handler: nil)
        alert.addAction(cancel)
        return alert
    }
    
    class func alertViewSelect(message: String, success: @escaping () -> Void) -> UIAlertController {
        let alert = UIAlertController.init(title: "提示", message: message, preferredStyle: .alert)
        let cancel = UIAlertAction.init(title: "取消", style: .cancel, handler: nil)
        let ok = UIAlertAction.init(title: "确定", style: .default) {(alert) in
            success()
        }
        alert.addAction(ok)
        alert.addAction(cancel)
        return alert
    }
    
    class func actionSheetSelect(message: String, success: @escaping () -> Void) -> UIAlertController {
        let sheet = UIAlertController.init(title: "提示", message: message, preferredStyle: .actionSheet)
        let cancel = UIAlertAction.init(title: "取消", style: .cancel, handler: nil)
        let ok = UIAlertAction.init(title: "确定", style: .default) {(alert) in
            success()
        }
        sheet.addAction(ok)
        sheet.addAction(cancel)
        return sheet
    }
        
}
